Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get wallet pubkey id if not available #92

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

danielgranhao
Copy link
Collaborator

No description provided.

@@ -105,8 +105,14 @@ impl AuthProvider {
Ok(access_token)
}

pub fn get_wallet_pubkey_id(&self) -> Option<String> {
self.wallet_pubkey_id.clone()
pub fn get_wallet_pubkey_id(&mut self) -> Result<String> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, maybe we do not complicate the provider, but implement it in the Auth like:

    pub fn get_wallet_pubkey_id(&self) -> Result<String> {
		match self.provider.lock().unwrap().get_wallet_pubkey_id() {
			Some(id) => Ok(id),
			None => {
				self.query_token()?;
				self.provider.lock().unwrap().get_wallet_pubkey_id().ok_or_permanent_failure("Failed to get pubkey id for an authenticated wallet")
			}
		}
    }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Applied in 180fd8d.

@danielgranhao danielgranhao force-pushed the feature/get-wallet-pubkey-id-if-not-available branch from 4f93f87 to 180fd8d Compare February 8, 2024 09:23
@danielgranhao danielgranhao merged commit d541d14 into main Feb 8, 2024
5 of 6 checks passed
@danielgranhao danielgranhao deleted the feature/get-wallet-pubkey-id-if-not-available branch February 8, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants